import { defineStore } from 'pinia';

const useSurveyStore = defineStore('survey', {
  state: () => ({
    id: String,
    name: String,
    description: String,
    from: Number,
    groupId: '',
    managedBy: 'admin',
    // 这个不应该在外面吗，上限
    answerLimit: String,
    questions: [
      {
        id: '',
        questionType: '',
        stem: '',
        // 下一个题的Id
        nextId: '',
        choices: [
          {
            id: '',
            content: '',
            // 这个选项的下一个题
            goTo: '',
          },
        ],
      },
    ],
  }),
});

export default useSurveyStore;
